import request from "@/utils/request"

//获取文章列表
export function getHome() {
    return request({
        url: 'api/article/lists'
    })
}

//添加文章
export function addArticle(params: any) {
    return request({
        url: 'api/article/save',
		data:params,
        method: 'post'
    })
}

//获取分类
export function getCategory() {
	return request({
		url: 'api/article/category',
		method: 'get'
	})
}

// 文章列表
export function articleLists(params?: any) {
    return request.get({ url: '/article.article/lists', params })
}
// 文章列表
export function articleAll(params?: any) {
    return request.get({ url: '/article/all', params })
}

// 添加文章
export function articleAdd(params: any) {
    return request.post({ url: '/article.article/add', params })
}

// 编辑文章
export function articleEdit(params: any) {
    return request.post({ url: '/article.article/edit', params })
}

// 删除文章
export function articleDelete(params: any) {
    return request.post({ url: '/article.article/delete', params })
}

// 文章详情
export function articleDetail(params: any) {
    return request({ url: 'api/article/detail', params })
}

// 文章分类状态
export function articleStatus(params: any) {
    return request.post({ url: '/article.article/updateStatus', params })
}


//获取列表
export function getArticleList() {
    return request({
        url: 'api/article/lists',
        method: 'get'
    })
}

//获取分类
export function getArticleCate() {
    return request({
        url: 'api/article/cate'
    })
}


/**
 * @description 文章详情
 * @return { Promise }
 */
export function getArticleDetail(params) {
    return request({ url: 'api/article/detail', params })
}
